import request from '@/utils/request'

export async function getProjectPlanCommonListApi(params) {
  var resp = await request({
    url: '/projectbase/commonsection/',
    method: 'get',
    params
  })
  return resp;
}
export async function getCommonGroupbySectionApi(params) {
  var resp = await request({
    url: '/projectbase/commonsection/get_groupbysection/',
    method: 'get',
    params
  })
  return resp
}

export async function createProjectPlanCommonApi(data) {
  var resp = await request({
    url: '/projectbase/commonsection/batch_create/',
    method: 'post',
    data
  })
  return resp
}

export async function updateProjectPlanCommonApi(data) {
  var resp = await request({
    url: '/projectbase/commonsection/batch_update/',
    method: 'put',
    data
  })
  return resp
}

export async function deleteProjectPlanCommonApi(data) {
  var resp = await request({
    url: '/projectbase/commonsection/batch_delete/',
    method: 'delete',
    data
  })
  return resp
}

// 用于获取多个Section的列表，返回的是一个包含多个Section的列表，每个Section包含多个Item
export async function getMoreSectionListApi(params) {
  var resp = await request({
    url: '/projectbase/moresection/',
    method: 'get',
    params
  })
  return resp;
}
// 用于对多个Section（eg：[{section1,{item1.value1}},{section2,{item2.value2}}]）进行批量创建
export async function createMoreSectionApi(data) {
  var resp = await request({
    url: '/projectbase/moresection/moreSectionCreate/',
    method: 'post',
    data
  })
  return resp
}
